home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Simple Sockets 1.1 / MacTCP Headers ƒ / Pre - Universal Headers / MacTCP Headers / TCPPB.h < prev    next >
Encoding:
Text File  |  1992-08-10  |  5.1 KB  |  108 lines  |  [TEXT/MPS ]

  1. /* 
  2.     TCPPB.h    
  3.     C definitions of parameter block entries needed for TCP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-91
  6.     All rights reserved
  7.     
  8. */
  9.  
  10.  
  11. /* Command codes */
  12.  
  13. #define TCPCreate            30
  14. #define    TCPPassiveOpen        31
  15. #define TCPActiveOpen        32
  16. #define TCPSend                34
  17. #define TCPNoCopyRcv        35
  18. #define TCPRcvBfrReturn        36
  19. #define TCPRcv                37
  20. #define TCPClose            38
  21. #define TCPAbort            39
  22. #define TCPStatus            40
  23. #define TCPExtendedStat        41
  24. #define TCPRelease            42
  25. #define TCPGlobalInfo        43
  26. #define TCPCtlMax            49
  27.  
  28. typedef enum TCPEventCode {
  29.     TCPClosing = 1,
  30.     TCPULPTimeout,
  31.     TCPTerminate,
  32.     TCPDataArrival,
  33.     TCPUrgent,
  34.     TCPICMPReceived,
  35.     lastEvent = 32767
  36. } TCPEventCode;
  37.  
  38. typedef enum TCPTerminationReason {
  39.     TCPRemoteAbort = 2,
  40.     TCPNetworkFailure,
  41.     TCPSecPrecMismatch,
  42.     TCPULPTimeoutTerminate,
  43.     TCPULPAbort,
  44.     TCPULPClose,
  45.     TCPServiceError,
  46.     lastReason = 32767
  47. } TCPTerminationReason; 
  48.  
  49. typedef pascal void (*TCPNotifyProc) (
  50.         StreamPtr tcpStream,
  51.         unsigned short eventCode,
  52.         Ptr userDataPtr,
  53.         unsigned short terminReason,
  54.         struct ICMPReport *icmpMsg);
  55.  
  56. typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb);
  57.  
  58. typedef unsigned short tcp_port;
  59.  
  60. typedef unsigned char byte;
  61.  
  62. enum {                    /* ValidityFlags */
  63.     timeoutValue = 0x80,
  64.     timeoutAction = 0x40,
  65.     typeOfService = 0x20,
  66.     precedence = 0x10
  67. };
  68.  
  69. enum {                    /* TOSFlags */
  70.     lowDelay = 0x01,
  71.     throughPut = 0x02,
  72.     reliability = 0x04
  73. };
  74.  
  75. typedef struct TCPCreatePB {
  76.     Ptr         rcvBuff;
  77.     unsigned long rcvBuffLen;
  78.     TCPNotifyProc     notifyProc;
  79.     Ptr         userDataPtr;
  80. }TCPCreatePB;
  81.  
  82. typedef struct TCPOpenPB {
  83.     byte ulpTimeoutValue;
  84.     byte ulpTimeoutAction;
  85.     byte validityFlags;
  86.     byte commandTimeoutValue;
  87.     ip_addr remoteHost;
  88.     tcp_port remotePort;
  89.     ip_addr localHost;
  90.     tcp_port localPort;
  91.     byte tosFlags;
  92.     byte precedence;
  93.     Boolean dontFrag;
  94.     byte timeToLive;
  95.     byte security;
  96.     byte optionCnt;
  97.     byte options[40];
  98.     Ptr userDataPtr;
  99. }TCPOpenPB;
  100.     
  101. typedef struct TCPSendPB {
  102.     byte ulpTimeoutValue;
  103.     byte ulpTimeoutAction;
  104.     byte validityFlags;
  105.     Boolean pushFlag;
  106.     Boolean urgentFlag;
  107.     Ptr wdsPtr;
  108.     unsigned